﻿using Treca.Business.Service;
using Treca.Business.Service.IBusiness;
using Treca.Quartz.Service.IBusiness;
using Treca.Util;
using EFCore.Sharding;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Treca.Quartz.Service.Business
{
    public class JobTypeBusiness : IJobTypeBusiness
    {
        public void Start()
        {
            //Console.WriteLine("EntityTypeBusiness is starting up!");
        }
        List<SystemBaseData> systemBaseDatas = new List<SystemBaseData>();
        public System.Linq.IQueryable<SystemBaseData> GetIQueryableAll()
        {
            return GetIQueryable();
        }
        public System.Linq.IQueryable<SystemBaseData> GetIQueryable()
        {
            if (systemBaseDatas.Count > 0) return systemBaseDatas.AsQueryable();
            foreach (var key in AutofacHelper.JobType.Keys)
            {
                systemBaseDatas.Add(new SystemBaseData(AutofacHelper.JobType[key].FullName, AutofacHelper.JobType[key].FullName));
            }
            return systemBaseDatas.AsQueryable();
        }
    }
}
